<!DOCTYPE HTML>
<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no" />
    <title>青藤CRM缴费系统</title>
    <meta name="keywords" content="智辉CRM">
    <meta name="description" content="智辉CRM">
    <link rel="Bookmark" href="favicon.ico">
    <link rel="Shortcut Icon" href="favicon.ico" />
    <!--[if lt IE 9]> 
    <script type="text/javascript" src="Lib/html5.js"></script>
    <script type="text/javascript" src="Lib/respond.min.js"></script>
    <script type="text/javascript" src="Lib/PIE_IE678.js"></script>
    <![endif]-->
    <link href="__PUBLIC__/css/H-ui.css" rel="stylesheet" type="text/css" />
    <link href="__PUBLIC__/lib/Hui-iconfont/1.0.6/iconfont.css" rel="stylesheet" type="text/css" />
    <link href="__PUBLIC__/css/style.css" rel="stylesheet" type="text/css" />
    <!--自己的样式-->
    <!-- <link href="Tpl/Assistant/common/expense/Center_index.css" rel="stylesheet" type="text/css"> -->
    <!--[if IE 6]> 
    <script type="text/javascript" src="Lib/DD_belatedPNG_0.0.8a-min.js" ></script>
    <script>DD_belatedPNG.fix('.pngfix,.icon');</script> 
    <![endif]-->
    <style>
      .form-horizontal .Validform_checktip{margin-top: -4px}
    </style>
</head>

<body>
    <div class="container">
               <form class="form-horizontal" id="form_name" method="post" action="{:U('appointing')}" style="margin-top: 10px;">
                   <input type="hidden" name="id" value="{$Think.get.id}" />

                <!-- <div class="row ">
                    <label for="" class="" style="font-size: 16px;font-weight: 500;">选择指派对象：</label>
                    <select class="select mt-10" size="1" name="handler_man" id="" style="height: 30px" >
                        <option value="">选择指派对象</option>
                        <volist name="data" id="v">
                          <option value="{$v.id}">{$v.real_name}-{$v.role_name}-{$v.DEPT_NAME}</option>
                        </volist>
                    </select>
                </div> -->
                <div class="row cl mb-20">
                        <label class="form-label col-3">小区：</label>
                        <div class="formControls col-8">
                            <span class="select-box input_h">
                              <select class="select parent" size="1" name="" id="Scate">
                              </select>
                            </span>
                        </div>
                        <div class="col-1"> </div>
                    </div>
                    <div class="row cl">
                        <label class="form-label col-3">指派人</label>
                        <div class="formControls col-8">
                            <span class="select-box input_h">
                              <select class="select child" size="1" name="handler_man" id="">
                              </select>
                            </span>
                        </div>
                        <div class="col-1"> </div>
                    </div>
                

                <div class="row mt-50">
                    <div class="col-12" style="text-align: center;">
                        
                        <input class="btn btn-primary size-M radius mt-15" style="width: 100%" type="submit" value="确认"/>
                    </div>
                </div>
               </form>
               
               
              
           
    </div>
    
    
    <script type="text/javascript" src="__PUBLIC__/lib/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/H-ui.js"></script>
    
    <script src="__PUBLIC__/lib/layer/2.1/layer.js"></script>
    <script src="Tpl/Assistant/common/expense/layerui.js"></script>
    <script src="__PUBLIC__/Validform/5.3.2/Validform.min.js"></script>
    <script src="http://cdn.bootcss.com/jquery.form/3.51/jquery.form.min.js"></script>
    <script>
        $(function(){
            $("#form_name").Validform({
            tiptype:2,
            ajaxPost:true,
            showAllError:true,
            beforeSubmit:function(curform){
            
                curform.ajaxSubmit({
                type:'POST',
                url:'{:U('Service/Order/appointing')}',
                success:function(data){
                  console.log(status);
                  if(data.status==true){
                      layer.msg("指派成功");
                      var index = parent.layer.getFrameIndex(window.name);
                      setTimeout(function(){
                           parent.layer.close(index);
                      },1000);
                      parent.location.reload();

                  }else{
                    layer.msg(data.msg);
                  }
                  }
                });
             return false; 
            }
          });
        });

        $(function(){
    //初始化教师下拉框
    // var lxurl = $.getEnvUrl();
    // alert(lxurl);
    $.post("/index.php?m=Service&c=Order&a=getCommunity",null,function(json){
        for(var i=0;i<json.length;i++){
            //添加一个教师
            $(".parent").append("<option value='"+json[i].id+"'>"+json[i].name+"</option>");
        }
        changChild($(".parent").val());
    },'json');
    //注册教师下拉框事件
    $(".parent").change(function(){
        changChild($(this).val());
    });
});

function changChild(tid){
    // var lxurl = $.getEnvUrl();
    $.post("/index.php?m=Service&c=Order&a=getAssistant",{"community_id":tid},function(json){
        $(".child").html("");//清空学生下拉框
        for(var i=0;i<json.length;i++){
            if(json[i].onLine==1)
                var status = '(在线)';
            else if(json[i].onLine==-1)
                var status = '(离线)';
            else
                var status = '(无状态)';
            $(".child").append("<option value='"+json[i].id+"'>"+json[i].real_name+'-'+json[i].role_name+'-'+json[i].DEPT_NAME+status+"</option>");
        }
    },'json');
}
    </script>
</body>

</html>

